<?php

namespace app\api\model;

use think\Model;

class NoticeRead extends Model
{
    public static function checkUserRead($noticeId, $userId)
    {
        return self::where(['nid' => $noticeId, 'uid' => $userId])->find();
    }

    public static function recordUserRead($noticeId, $userId)
    {
        return self::insert([
            'nid' => $noticeId,
            'uid' => $userId,
            'create_time' => time()
        ]);
    }
}